home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / AIncludes / AppleScript.a < prev    next >
Encoding:
Text File  |  1993-12-02  |  5.9 KB  |  174 lines  |  [TEXT/MPS ]

  1. ;////////////////////////////////////////////////////////////////////////////////
  2. ;// OPEN SCRIPTING ARCHITECTURE: AppleScript Specific Interface
  3. ;////////////////////////////////////////////////////////////////////////////////
  4. ;// Copyright © 1992, 1993 Apple Computer, Inc. All rights reserved.
  5. ;// Authors: William Cook, Donn Denman, and Warren Harris
  6. ;////////////////////////////////////////////////////////////////////////////////
  7.  
  8.  IF &TYPE('__INCLUDINGAPPLESCRIPT__') = 'UNDEFINED' THEN
  9. __INCLUDINGAPPLESCRIPT__ SET 1
  10.  
  11.  IF &TYPE('__INCLUDINGOSA__') = 'UNDEFINED' THEN
  12.  INCLUDE 'OSA.a'
  13.  ENDIF
  14.  
  15.  IF &TYPE('__INCLUDINGTEXTEDIT__') = 'UNDEFINED' THEN
  16.  ;INCLUDE 'TextEdit.a'
  17.  ENDIF
  18.  
  19. ;////////////////////////////////////////////////////////////////////////////////
  20. ;// Types and Constants
  21. ;////////////////////////////////////////////////////////////////////////////////
  22.  
  23. typeAppleScript        EQU    'ascr'
  24.  
  25. kAppleScriptSubtype    EQU    typeAppleScript
  26.  
  27. ; The specific type for the AppleScript instance of the
  28. ; Open Scripting Architecture type.
  29.  
  30. typeASStorage    EQU    typeAppleScript
  31.  
  32. ;////////////////////////////////////////////////////////////////////////////////
  33. ;// Script Error Codes
  34. ;////////////////////////////////////////////////////////////////////////////////
  35.  
  36. ; Runtime errors:
  37. errASCantConsiderAndIgnore    EQU    -2720
  38. errASCantCompareMoreThan32k    EQU    -2721
  39.     
  40. ; Parser/Compiler errors:
  41. errASTerminologyNestingTooDeep    EQU    -2760
  42. errASIllegalFormalParameter    EQU    -2761
  43. errASParameterNotForEvent    EQU    -2762
  44. errASNoResultReturned    EQU    -2763
  45.  
  46. ; Dialect specific script errors:
  47. ; The range -2780 thru -2799 is reserved for dialect specific error codes.
  48. ; (Error codes from different dialects may overlap.)
  49.  
  50. ; English errors:
  51. errASInconsistentNames    EQU    -2780
  52.  
  53. ;////////////////////////////////////////////////////////////////////////////////
  54. ;// Component Selectors
  55. ;////////////////////////////////////////////////////////////////////////////////
  56.  
  57. kASSelectInit        EQU    $1001
  58. kASSelectSetSourceStyles    EQU    $1002
  59. kASSelectGetSourceStyles    EQU    $1003
  60. kASSelectGetSourceStyleNames    EQU    $1004
  61.  
  62. ;////////////////////////////////////////////////////////////////////////////////
  63. ;// OSAGetScriptInfo Selectors
  64. ;////////////////////////////////////////////////////////////////////////////////
  65.  
  66. kASHasOpenHandler    EQU    'hsod'
  67. ; This selector is used to query a context as to whether it contains
  68. ; a handler for the kAEOpenDocuments event. This allows "applets" to be 
  69. ; distinguished from "droplets."  OSAGetScriptInfo returns false if
  70. ; there is no kAEOpenDocuments handler, and returns the error value 
  71. ; errOSAInvalidAccess if the input is not a context.
  72.  
  73. ;////////////////////////////////////////////////////////////////////////////////
  74. ;// Initialization
  75. ;////////////////////////////////////////////////////////////////////////////////
  76.  
  77. ;pascal OSAError
  78. ;ASInit(ComponentInstance    scriptingComponent,
  79. ;       long    modeFlags,
  80. ;       long    minStackSize,
  81. ;       long    preferredStackSize,
  82. ;       long    maxStackSize,
  83. ;       long    minHeapSize,
  84. ;       long    preferredHeapSize,
  85. ;       long    maxHeapSize);
  86. ;
  87. ;    // This call can be used to explicitly initialize AppleScript.  If it is
  88. ;    // not called, the a scripting size resource is looked for and used. If
  89. ;    // there is no scripting size resource, then the constants listed below
  90. ;    // are used.  If at any stage (the init call, the size resource, the 
  91. ;    // defaults) any of these parameters are zero, then parameters from the
  92. ;    // next stage are used.  ModeFlags are not currently used.
  93. ;    // Errors: errOSASystemError = initialization failed
  94.  
  95.         MACRO
  96.         _ASInit
  97.         MOVE.L    #((28<<16)|kASSelectInit),-(A7)
  98.         MOVEQ    #$0,D0
  99.         DC.W    $A82A    ; TB 002A
  100.         ENDM
  101.  
  102. ; These values will be used if ASInit is not called explicitly, or if any
  103. ; of ASInit's parameters are zero:
  104. kASDefaultMinStackSize    EQU    ( 4 * 1024)
  105. kASDefaultPreferredStackSize    EQU    (16 * 1024)
  106. kASDefaultMaxStackSize    EQU    (16 * 1024)
  107. kASDefaultMinHeapSize    EQU    ( 4 * 1024)
  108. kASDefaultPreferredHeapSize    EQU    (16 * 1024)
  109. kASDefaultMaxHeapSize    EQU    (32 * 1024 * 1024)
  110.  
  111. ;////////////////////////////////////////////////////////////////////////////////
  112. ;// Source Styles
  113. ;////////////////////////////////////////////////////////////////////////////////
  114.  
  115. ;pascal OSAError
  116. ;ASSetSourceStyles(ComponentInstance    scriptingComponent,
  117. ;      STHandle        sourceStyles);
  118. ;    // Errors: errOSASystemError = operation failed
  119.  
  120.         MACRO
  121.         _ASSetSourceStyles
  122.         MOVE.L    #((4<<16)|kASSelectSetSourceStyles),-(A7)
  123.         MOVEQ    #$0,D0
  124.         DC.W    $A82A    ; TB 002A
  125.         ENDM
  126.  
  127.  
  128. ;pascal OSAError
  129. ;ASGetSourceStyles(ComponentInstance    scriptingComponent,
  130. ;      STHandle*        resultingSourceStyles) ;
  131. ;    // Errors: errOSASystemError = operation failed
  132.  
  133.         MACRO
  134.         _ASGetSourceStyles
  135.         MOVE.L    #((4<<16)|kASSelectGetSourceStyles),-(A7)
  136.         MOVEQ    #$0,D0
  137.         DC.W    $A82A    ; TB 002A
  138.         ENDM
  139.  
  140. ;pascal OSAError
  141. ;SGetSourceStyleNames(ComponentInstance    scriptingComponent,
  142. ;          long        modeFlags,
  143. ;          AEDescList*    resultingSourceStyleNamesList);
  144. ;    // This call returns an AEList of styled text descriptors the names of the
  145. ;    // source styles in the current dialect.  The order of the names corresponds
  146. ;    // to the order of the source style constants, below.  The style of each
  147. ;    // name is the same as the styles returned by ASGetSourceStyles.
  148. ;    // 
  149. ;    // Errors: errOSASystemError = operation failed
  150.  
  151.         MACRO
  152.         _ASGetSourceStyleNames
  153.         MOVE.L    #((8<<16)|kASSelectGetSourceStyleNames),-(A7)
  154.         MOVEQ    #$0,D0
  155.         DC.W    $A82A    ; TB 002A
  156.         ENDM
  157.  
  158. ; Elements of STHandle correspond to following categories of tokens, and
  159. ; accessed through following index constants:
  160. kASSourceStyleUncompiledText    EQU    0
  161. kASSourceStyleNormalText    EQU    1
  162. kASSourceStyleLanguageKeyword    EQU    2
  163. kASSourceStyleApplicationKeyword EQU    3
  164. kASSourceStyleComment    EQU    4
  165. kASSourceStyleLiteral    EQU    5
  166. kASSourceStyleUserSymbol    EQU    6
  167. kASSourceStyleObjectSpecifier    EQU    7
  168. kASNumberOfSourceStyles    EQU    8
  169.  
  170. ;//////////////////////////////////////////////////////////////////////////////////////////////////////
  171. ;// You're still here?  Go home.
  172.  ENDIF
  173. ;//////////////////////////////////////////////////////////////////////////////////////////////////////
  174.